package com.vito.dcs.water.waterDataLog.service.impl;

import java.util.*;
import org.springframework.beans.factory.annotation.*;

import com.vito.dcs.water.waterDataLog.model.DataWaterBlenderLogModel;
import com.vito.dcs.water.waterDataLog.service.DataWaterBlenderLogService;
import com.alibaba.dubbo.config.annotation.Service;
import com.vito.dcs.water.waterDataLog.dao.DataWaterBlenderLogMapper;
import com.vito.base.model.DataGrid;
import com.vito.base.factory.IDFactory;

/**
 * DataWaterBlenderLogService接口实现类
 * @author  fangj E-mail: 
 * @version 0.1.1
 * @date    2019-4-12 14:21:46
 */
@Service
public class DataWaterBlenderLogServiceImpl implements DataWaterBlenderLogService {
	
	@Autowired
	private DataWaterBlenderLogMapper datawaterblenderlogMapper;
	
	@Override
	public int save(DataWaterBlenderLogModel datawaterblenderlog){
		return datawaterblenderlogMapper.save(datawaterblenderlog);
	}
	@Override
	public DataGrid<DataWaterBlenderLogModel> queryAllByPage(DataWaterBlenderLogModel datawaterblenderlog){
		DataGrid<DataWaterBlenderLogModel> dg = new DataGrid<DataWaterBlenderLogModel>();
		dg.setRows(datawaterblenderlogMapper.queryAllByPage(datawaterblenderlog));
		dg.setTotal(datawaterblenderlog.getTotal());
		return dg;
	}
	@Override
	public DataWaterBlenderLogModel query(DataWaterBlenderLogModel datawaterblenderlog){
		return datawaterblenderlogMapper.query(datawaterblenderlog);
	}
	@Override
	public Integer update(DataWaterBlenderLogModel datawaterblenderlog){
		return datawaterblenderlogMapper.update(datawaterblenderlog);
	}
	
	@Override
	public Integer delete(DataWaterBlenderLogModel datawaterblenderlog){
		return datawaterblenderlogMapper.delete(datawaterblenderlog);
	}

    @Override
	public int saveDataWaterBlenderLog(DataWaterBlenderLogModel datawaterblenderlog){
	    datawaterblenderlog.setId(IDFactory.getIDFactory().getIdInc()+"");    
		return save(datawaterblenderlog);
	}
}